package com.aspose.cells;

class ztl {
   private zol a;
   private int b;
   private int c = 1;

   ztl(zol var1) {
      this.a = var1;
      this.b = this.a.b.getWorksheets().L();
   }

   void a(zcfx var1) throws Exception {
      var1.b("xml");
      var1.a("xmlns", "v", (String)null, "urn:schemas-microsoft-com:vml");
      var1.a("xmlns", "o", (String)null, "urn:schemas-microsoft-com:office:office");
      var1.a("xmlns", "x", (String)null, "urn:schemas-microsoft-com:office:excel");
      this.b(var1);
      this.c(var1);
      ShapeCollection var2 = this.a.a.getPageSetup().j();

      for(int var3 = 0; var3 < var2.getCount(); ++var3) {
         Picture var4 = (Picture)var2.get(var3);
         this.a(var1, var4);
      }

      var1.b();
      var1.e();
   }

   private void b(zcfx var1) throws Exception {
      var1.c("o:shapelayout", (String)null);
      var1.a("v:ext", (String)null, "edit");
      var1.c("o:idmap", (String)null);
      var1.a("v:ext", (String)null, "edit");
      var1.a("data", "1");
      var1.b();
      var1.b();
   }

   private void c(zcfx var1) throws Exception {
      var1.c("v:shapetype", (String)null);
      var1.a("id", "\u0000t75");
      var1.a("coordsize", "21600,21600");
      var1.a("o:spt", (String)null, "75");
      var1.a("o:preferrelative", (String)null, "t");
      var1.a("path", "m@4@5l@4@11@9@11@9@5xe");
      var1.a("filled", "f");
      var1.a("stroked", "f");
      var1.c("v:stroke", (String)null);
      var1.a("joinstyle", "miter");
      var1.b();
      this.d(var1);
      var1.c("v:path", (String)null);
      var1.a("o:extrusionok", (String)null, "f");
      var1.a("gradientshapeok", "t");
      var1.a("o:connecttype", (String)null, "rect");
      var1.b();
      this.a(var1, true);
      var1.b();
   }

   private void a(zcfx var1, boolean var2) throws Exception {
      var1.c("o:lock", (String)null);
      var1.a("v:ext", (String)null, "edit");
      if (var2) {
         var1.a("aspectratio", "t");
      } else {
         var1.a("rotation", "t");
      }

      var1.b();
   }

   private void d(zcfx var1) throws Exception {
      var1.c("v:formulas", (String)null);
      this.a(var1, "if lineDrawn pixelLineWidth 0");
      this.a(var1, "sum @0 1 0");
      this.a(var1, "sum 0 0 @1");
      this.a(var1, "prod @2 1 2");
      this.a(var1, "prod @3 21600 pixelWidth");
      this.a(var1, "prod @3 21600 pixelHeight");
      this.a(var1, "sum @0 0 1");
      this.a(var1, "prod @6 1 2");
      this.a(var1, "prod @7 21600 pixelWidth");
      this.a(var1, "sum @8 21600 0");
      this.a(var1, "prod @7 21600 pixelHeight");
      this.a(var1, "sum @10 21600 0");
      var1.b();
   }

   private void a(zcfx var1, String var2) throws Exception {
      var1.c("v:f", (String)null);
      var1.a("eqn", var2);
      var1.b();
   }

   private void a(zcfx var1, Picture var2) throws Exception {
      var1.c("v:shape", (String)null);
      var1.a("id", var2.getName());
      var1.a("type", "#\u0000t75");
      var1.a("style", this.a((Shape)var2));
      var1.c("v:imagedata", (String)null);
      String var3 = (String)this.a.l.d.get(var2.b());
      var1.a("o:relid", (String)null, var3);
      if (var2.getFormatPicture().getTopCrop() > 0.0D) {
         var1.a("croptop", zase.b(var2.getFormatPicture().getTopCrop() * 65536.0D) + "f");
      }

      if (var2.getFormatPicture().getBottomCrop() > 0.0D) {
         var1.a("cropbottom", zase.b(var2.getFormatPicture().getBottomCrop() * 65536.0D) + "f");
      }

      if (var2.getFormatPicture().getLeftCrop() > 0.0D) {
         var1.a("cropleft", zase.b(var2.getFormatPicture().getLeftCrop() * 65536.0D) + "f");
      }

      if (var2.getFormatPicture().getRightCrop() > 0.0D) {
         var1.a("cropright", zase.b(var2.getFormatPicture().getRightCrop() * 65536.0D) + "f");
      }

      var1.b();
      this.a(var1, false);
      var1.b();
   }

   private String a(Shape var1) {
      String var2 = "position:absolute;margin-left:" + var1.getLeftToCorner() + "px;margin-top:" + var1.getTopToCorner() + "px;width:" + zase.y(var1.getWidth()) + "px;height:" + zase.y(var1.getHeight()) + "px;z-index:" + this.c + ";";
      ++this.c;
      return var2;
   }
}
